package cn.gameback.r03_24311133.r04;


import cn.gameback.r03_24311133.r01.Employee;
import cn.gameback.r03_24311133.r03.EmployeeService;
import jakarta.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/emp")
public class EmployeeController {
    @Autowired
    private EmployeeService service;
    //http://localhost:8080/emp/selAll.do
    @RequestMapping("selAll.do")
    public List<Employee> selectAll() {
        return service.selectAll();
    }

    @RequestMapping("sel.do")
    String sel(int id, HttpSession session){
        System.out.println(session);
        session.setAttribute("user", "24311133");
        return "请求成功";
    }
}
